package cn.byapps.hw.controller;

import cn.byapps.hw.entity.SerialPK;
import cn.byapps.hw.service.SerialPKService;
import cn.byapps.hw.vo.ClazzTimetableData;
import cn.byapps.hw.vo.VueData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.ParseException;

@RestController
@RequestMapping("/api/serialpk")
public class SerialPKController {

    @Resource
    private SerialPKService serialPKService;

    @PostMapping
    public VueData add(@RequestBody SerialPK serialPK) {
        serialPKService.save(serialPK);
        return new VueData();
    }

    @PostMapping("/addmore")
    public VueData<String> addmore(@RequestBody ClazzTimetableData clazzTimetableData) throws ParseException {
        return serialPKService.addmore(clazzTimetableData);
    }
}
